Coding conventions allow teams to work efficiently together. This rule checks that the public
section of a class is declared first,
followed by the protected
section, and ending with the private
section.
Noncompliant code example
class Point
{
private:
String _color;
...
protected:
...
public:
String getColor();
String setColor();
};
Compliant solution
class Point
{
public:
String getColor();
String setColor();
protected:
...
private:
String _color;
...
};